package simple;

import java.util.Random;
import java.util.Scanner;
import static java.lang.System.out;

public class Test4 {
	public static void main(String[] args) {
		int numberToGuss = new Random().nextInt(100);
		Scanner scanner = new Scanner(System.in);
		out.println("请输入一个整数:");
		for(int i = 0;i< 3; i++) {
			int input = scanner.nextInt();
			if (input > numberToGuss) {
				out.println("大了");
			} else if(input < numberToGuss){
				out.println("小了");
			} else {
				out.println("答对啦!");
			}
			if (i == 2) {
				out.println("您已经猜错三次!");
			}
		}
		scanner.close();
	}
}
